export {}
// 函数可选参数的定义方法
function mySlice(arr: string[], start?: number, end?: number): string[] {
    return arr.slice(start, end)
}

const result1 = mySlice(['a','b', 'c'])
console.log(result1)


const result2 = mySlice(['a','b', 'c'], 1)
console.log(result2)

const result3 = mySlice(['a','b', 'c'], 0, 2)
console.log(result3)

function mySlice3(arr: number[], start: number = 0, end?: number): number[] {
    return arr.slice(start, end);
}